﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.ServiceModel;

namespace Studio.Windows.Update
{
    public partial class FormUpdate : Form
    {
        public FormUpdate()
        {
            InitializeComponent();
        }

        ServiceHost updateService = null;

        private void button1_Click(object sender, EventArgs e)
        {
            Uri baseAddress = new Uri(textBox1.Text);
            updateService = new ServiceHost(typeof(UpdateService), new Uri[] { baseAddress });
            updateService.Open();
            button1.Enabled = false;
            button2.Enabled = true;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            updateService.Close();
            button1.Enabled = true;
            button2.Enabled = false;
        }
    }
}
